package com.guessnumber.guess.chestinterface;

import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import com.guessnumber.guess.chestinterface.extendwidget.first;

import java.util.Arrays;
import java.util.List;

public class testitem implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        myinv inv = new myinv(3,"test");
        //String[] _w1 = {"1"};
        List<String> _w1 = Arrays.asList("test");
        first w1 = new first(2,1,Material.DIAMOND,"test",_w1,0,1);
        first w2 = new first(1,2,Material.DIAMOND,"test",_w1,0,1);
        first w3 = new first(3,2,Material.DIAMOND,"test",_w1,0,1);
        first w4 = new first(2,3,Material.DIAMOND,"test",_w1,0,1);
        inv.AddWidget(w1);
        inv.AddWidget(w2);
        inv.AddWidget(w3);
        inv.AddWidget(w4);
        if (sender instanceof Player){
            ((Player) sender).openInventory(inv.pack());
        }
        return false;
    }
}
